home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Programming / amigatalk / testfiles / TestParallelHdwe < prev    next >
Encoding:
Text File  |  2001-03-06  |  1.2 KB  |  45 lines

  1. par <- ParallelDevice new: 2r00101000 "PARF_SHARED | PARF_FASTMODE"
  2.  
  3. "This test file requires that you actually monitor the Parallel port's"
  4. "pins with an oscilloscope, since it does some wild things that no"
  5. "self-respecting printer will tolerate!"
  6.  
  7. "  The returned status has the following meaning:"
  8.  
  9. "    BIT:  ACTIVE:  FUNCTION:"
  10.  
  11. "     0      HIGH   Printer Busy toggle (offline)."
  12. "     1      HIGH   Paper out."
  13. "     2      HIGH   Printer Select."
  14. "     3      ----   Read = 0, Write = 1"
  15. "     4-7    ----   Reserved."
  16.  
  17. ('Status is ', (par status) asString) print 
  18.  
  19. "Monitor (with a scope or test instrument) the ctrl bits for fluctuation:"
  20.  
  21. 'Toggling parallel control bits...' print
  22.  
  23. par testToggleCtrlBits: 500 "Loop for around 35 seconds."
  24.  
  25. bits <- par readControlBitsMaskedBy: 16r07
  26.  
  27. ('The control bits are: ', (bits asString)) print
  28.  
  29. ('Status is ', (par status) asString) print 
  30.  
  31. "Monitor (with a scope or test instrument) the data bits for fluctuation:"
  32.  
  33. 'Toggling parallel data bits...' print
  34.  
  35. par testToggleDataBits: 500 "Loop for around 35 seconds."
  36.  
  37. ('Last status is ', (par status) asString) print 
  38.  
  39. par stopPort
  40. par flushPort
  41. par resetPort
  42. par close
  43.  
  44. 'Now, hook up a printer to the Parallel port & run TestParallel2' print
  45.